// import com.alibaba.druid.sql.ast.statement.SQLExprTableSource;
// import com.alibaba.druid.sql.dialect.mysql.visitor.MySqlASTVisitor;

// import java.util.ArrayList;
// import java.util.List;

#include "MySqlChecksumTableStatement.h"
#include "../../../../ast/statement/SQLExprTableSource.h"
#include "../../visitor/MySqlASTVisitor.h"
#include "../../../../../utils/listTran.h"

MySqlChecksumTableStatement::MySqlChecksumTableStatement()
{
  tables = std::make_shared<std::list<SQLExprTableSource_ptr>>();
}

void MySqlChecksumTableStatement::addTable(SQLExprTableSource_ptr table)
{
  if (table == nullptr)
  {
    return;
  }

  table->setParent(SharedObject(MySqlChecksumTableStatement));
  tables->push_back(table);
}

SQLExprTableSource_list_ptr MySqlChecksumTableStatement::getTables()
{
  return tables;
}

BOOL_ptr MySqlChecksumTableStatement::isQuick()
{
  return quick;
}

void MySqlChecksumTableStatement::setQuick(BOOL_ptr quick)
{
  this->quick = quick;
}

BOOL_ptr MySqlChecksumTableStatement::isExtended()
{
  return extended;
}

void MySqlChecksumTableStatement::setExtended(BOOL_ptr extended)
{
  this->extended = extended;
}

void MySqlChecksumTableStatement::accept0(MySqlASTVisitor_ptr visitor)
{
  if (visitor->visit(SharedObject(MySqlChecksumTableStatement)))
  {
    SQLObject_list_ptr tmp = ListTran::tran_class<SQLExprTableSource, SQLObject>(tables);
    acceptChild(visitor, tmp);
  }
  visitor->endVisit(SharedObject(MySqlChecksumTableStatement));
}
